CREATE EXTERNAL TABLE jms_dwd.dwd_tab_barscan_transfer_mail_base_dt (
    RECORD_ID string COMMENT '记录编号',
    BILL_CODE string COMMENT '运单编号',
    SCAN_TYPE string COMMENT '扫描类型',
    SCAN_USER string COMMENT '扫描雇员',
    INPUT_SITE string COMMENT '录入部门',
    SCAN_TIME timestamp COMMENT '扫描时间',
    INPUT_TIME timestamp COMMENT '录入时间',
    OPERATE_DATE timestamp COMMENT '操作日期',
    SEND_DELIVER_USER string COMMENT '派件或收件员',
    VILLAGE_FLAG bigint COMMENT '进村件标识 0 否 1 是',
    TRANSFER_FLAG bigint COMMENT '转邮标识 1 菜鸟 2 邮政',
    REMARK string COMMENT '备注',
    MODIFY_USER string COMMENT '修改人',
    MODIFY_TIME timestamp COMMENT '修改时间',
    MOBILE string COMMENT '手机号码',
    PISTOL_ID string COMMENT '巴枪ID',
    REMARK1 string COMMENT '备注1',
    REMARK2 string COMMENT '备注2',
    SCAN_SITE_CODE string COMMENT '扫描网点编号',
    UPLOAD_TIME timestamp COMMENT '上传时间',
    REMARK3 string COMMENT '备注3',
    SCAN_USER_CODE string COMMENT '扫描雇员编号',
    SEND_DELIVER_USER_CODE string COMMENT '收派员编号',
    SOURCE string COMMENT '来源',
    REMARK5 string COMMENT '备注5',
    REMARK6 bigint COMMENT '备注6',
    REMARK4 string COMMENT '备注4',
    SCAN_SITE_ID bigint COMMENT '扫描网点ID',
    SCAN_USER_ID bigint COMMENT '扫描雇员ID',
    SEND_DELIVER_USER_ID bigint COMMENT '收派员ID',
    `network_type`          tinyint comment "扫描网点类型，1.加盟商,2.转运中心,3.集散点,4.普通网点,5.代理区,6.总部,0.其他",
    `site_agent_code`       string comment "所属代理区code",
    `site_agent_name`       string comment "所属代理区名称",
    `site_franchisee_code`  string comment "所属加盟商code ",
    `site_franchisee_name`  string comment "所属加盟商名称",
    `site_transcenter_code` string comment "所属转运中心code",
    `site_transcenter_name` string comment "所属转运中心名称",
    `waybill_source`        string comment "运单来源：GB:国标单号,BS:百世单号,BSB:百世包号,JT:极兔单号,JTB:极兔包号,Other:其它"
) comment '转邮扫描'
PARTITIONED BY (dt STRING COMMENT '时间分区')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dwd.db/external/dwd_tab_barscan_transfer_mail_base_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
);
